package club.baimahu.pencil.domain.entity.account;

import club.baimahu.pencil.domain.entity.Buyer;
import club.baimahu.pencil.domain.entity.Seller;

import java.util.UUID;

/**
 * 购买商品交易记录,包括买家和卖家
 */
public class ShoppingTrade implements Trade{

    private Buyer buyer;

    private Seller seller;

    private String tradeNo;

    public ShoppingTrade(Buyer buyer,Seller seller){
        this.buyer = buyer;
        this.seller= seller;
        this.tradeNo = UUID.randomUUID().toString();
    }

    public ShoppingTrade(Buyer buyer,Seller seller,String tradeNo ){
        this.buyer = buyer;
        this.seller= seller;
        this.tradeNo = tradeNo;

    }

    @Override
    public String tradeNo() {
        return this.tradeNo;
    }

    @Override
    public String tradeDescription() {
        return null;
    }

/*    @Override
    public String tradeDescription() {
        return StringUtils.format("seller account={},buyer account={},tradeNo={},trade time={}",
                seller.accountName(),buyer.accountName(),tradeNo(), LocalDate.now());
    }*/
}
